<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head lang="en">
	<th:block th:include="include :: header('首页')" />
	<th:block th:include="include :: headertable" />
</head>
<body style="margin: auto">

<form class="layui-form" style="padding: 10px">
	<div class="layui-form-item">
		<label class="layui-form-label">原密码</label>
		<div class="layui-input-block">
			<input type="password" id="oldpass" name="oldPass" required lay-verify="required"
				   class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">新密码</label>
		<div class="layui-input-block">
			<input type="password" id="newpass" name="newPass" required
				   lay-verify="required"
				   class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">确认密码</label>
		<div class="layui-input-block">
			<input type="password" id="newpass1" name="newPass1" required
				   lay-verify="required"
				   class="layui-input">
		</div>
	</div>
	<div style="display: none">
		<button class="layui-btn" lay-submit lay-filter="*" id="submit">立即提交</button>
	</div>

</form>

<th:block th:include="include :: footer" />
<script type="text/javascript">
	layui.use(['form'], function () {
		var form = layui.form;
		form.on('submit(*)', function (data) {
			if (data.field.newPass !== data.field.newPass1) {
				config.alert("两次密码输入不一致");
				return false;
			}
			config.commPost("/sysUser/modifyHtPass.json", data.field, function (data, info) {
				parent.config.closeLayer(info);

			})
			return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});

	})




	function ApplicationSave() {
		document.getElementById("submit").click();
		// var oldPass=$("#oldpass").val();
		// var newPass=$("#newpass").val();
		// var newPass1=$("#newpass1").val();
		// if(!oldPass){
		// 	layer.alert("请输入旧密码");
		// 	return;
		// }
		// if(!newPass){
		// 	parent.layer.alert("请输入新密码");
		// 	return;
		// }
		// if(newPass1.indexOf(newPass)!==0||newPass.indexOf(newPass1)!==0){
		// 	parent.layer.alert("两次密码输入不一致");
		// 	return;
		// }
		// if(oldPass.indexOf(newPass)===0&&newPass.indexOf(oldPass)===0){
		// 	parent.layer.alert("新旧密码一致");
		// 	return;
		// }
		//
		// config.commPost("/sysUser/modifyHtPass.json",{oldPass:oldPass,newPass:newPass},function (data,info) {
		// 	var layers=parent.layer;
		// 	var parents=parent;
		// 	layers.alert(info,function (index) {
		// 		parents.hd(info);
		// 		layers.close(index);
		// 	})
		//
		// })
	}

</script>
</body>
</html>


